<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<h:form rendered="#{currentUser.teacher}">
	<h:panelGrid columns="2" columnClasses="labelText, normalText">
		<h:outputText value="Nazwa grupy" />
		<h:outputText value="#{groupBean.group.groupName}" />
		<h:outputText value="Temat projektu" />
		<h:outputText value="#{groupBean.group.subject.topic}" />
	</h:panelGrid>
<br>
<h:outputText value="Historia notatek" />
<h:dataTable binding="#{groupBean.dataTable}" value="#{groupBean.notes}" var="note" headerClass="tableHeader" styleClass="dataTable" rowClasses="oddRow">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Data" />
		</f:facet>
		<h:outputText value="#{note.event.startDate}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Notatka" />
		</f:facet>
		<h:outputText value="#{note.text}" />
	</h:column>
</h:dataTable>
<br>
<h:outputText value="Aktualna notatka" />
<h:inputText value="#{groupBean.note.text}" id="notatka" required="true" />
<h:message for="notatka" styleClass="errorMsg" />
<h:commandButton  value="Zapisz notatke" action="#{groupBean.updateNote}" />
<br>
<h:dataTable binding="#{groupBean.dataTable2}" value="#{groupBean.students}" var="student" headerClass="tableHeader" styleClass="dataTable" rowClasses="oddRow, evenRow">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Studenci: " />
		</f:facet>
		<h:outputText value="#{student.name}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="" />
		</f:facet>
		<h:commandButton value="Dodaj ocene" action="#{groupBean.goToStudentMarks}" />
	</h:column>
</h:dataTable>
<h:commandButton value="Powrot do listy grup" action="nav_current_event_groups" />
</h:form>